package com.siam.package_rider.feign;

import com.siam.package_common.entity.BasicResult;
import com.siam.package_rider.entity.TbDeliveryOrder;
import com.siam.package_rider.entity.TbRider;
import com.siam.package_rider.model.param.TbDeliveryOrderParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "rider-siam")
public interface DeliveryOrderFeignApi {

    /**
     * 保存配送订单表
     * @param param
     * @return
     */
    @PostMapping(value="/rest/rider/deliveryOrder/insert")
    public BasicResult insert(@RequestBody TbDeliveryOrderParam param);

    /**
     * 删除配送订单表
     * @param id
     * @return
     */
    @PostMapping(value="/rest/rider/deliveryOrder/delete")
    BasicResult delete(@RequestParam("id") Long id);

    /**
     * 批量删除配送订单表
     * @param idList
     * @return
     */
    @PostMapping(value="/rest/rider/deliveryOrder/batchDelete")
    BasicResult batchDelete(@RequestBody List<Long> idList);

    /**
     * 修改配送订单表
     * @param param
     * @return
     */
    @PostMapping(value="/rest/rider/deliveryOrder/updateById")
    BasicResult updateById(@RequestBody TbDeliveryOrder param);

    /**
     * 根据主键查询
     * @param id
     * @return
     */
    @PostMapping(value="/rest/rider/deliveryOrder/findById")
    BasicResult<TbDeliveryOrder> findById(@RequestParam("id") Long id);

    @PostMapping(value="/rest/rider/deliveryOrder/selectByOriginOrderId")
    BasicResult<TbDeliveryOrder> selectByOriginOrderId(@RequestParam("originOrderId") int originOrderId);

    /**
     * 修改状态为已取消
     * @param id
     * @return
     */
    @PostMapping(value="/rest/rider/deliveryOrder/updateOrderByCancel")
    BasicResult updateOrderByCancel(@RequestParam("id") Long id);
}